File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change 6
6
// Add services to the container.
7
7
8
8
builder . Services . AddControllers ( ) ;
9
+
9
10
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
10
11
builder . Services . AddEndpointsApiExplorer ( ) ;
11
12
14
15
15
16
builder . Services . AddCors ( options =>
16
17
{
17
- options . AddPolicy ( "NewPolicy" , builder =>
18
- builder . AllowAnyOrigin ( )
19
- . AllowAnyMethod ( )
20
- . AllowAnyHeader ( ) ) ;
18
+ options . AddPolicy (
19
+ "NewPolicy" ,
20
+ builder => builder . AllowAnyOrigin ( ) . AllowAnyMethod ( ) . AllowAnyHeader ( )
21
+ ) ;
21
22
} ) ;
22
23
23
24
var app = builder . Build ( ) ;
24
25
25
26
// Configure the HTTP request pipeline.
26
- if ( app . Environment . IsDevelopment ( ) )
27
- {
28
- app . UseSwagger ( ) ;
29
- app . UseSwaggerUI ( ) ;
30
- }
27
+ app . UseSwagger ( ) ;
28
+ app . UseSwaggerUI ( ) ;
31
29
32
30
app . UseHttpsRedirection ( ) ;
33
31
app . UseCors ( "NewPolicy" ) ;
38
36
// Register custom serializers
39
37
BsonSerializer . RegisterSerializer ( new RecordingPlayerSerializer ( ) ) ;
40
38
BsonSerializer . RegisterSerializer ( new RecordingEventSerializer ( ) ) ;
41
- app . Run ( ) ;
39
+ app . Run ( ) ;
40
+
You can’t perform that action at this time.
0 commit comments